package com.lx.mobileplayer.utils

import com.lx.mobileplayer.mvp.view.fragment.*

/**
 * 类说明：fragment工厂
 * Created by liuxiong on 2019/4/24.
 */
class FragmentFactory private constructor(){

    val homeFragment by lazy { HomeFragment() }
    val mvFragment by lazy { MvFragment() }
    val vBangFragment by lazy { VBangFragment() }
    val yueDanFragment by lazy { YueDanFragment() }

    companion object {
        val instance by lazy {
            FragmentFactory()
        }
    }

    fun getFragment(index:Int):BaseFragment=when(index){
        0-> homeFragment
        1-> mvFragment
        2-> vBangFragment
        3-> yueDanFragment
        else -> homeFragment
    }
}